package com.example.administrator.mvp.model.user;

import android.content.Context;

import com.example.administrator.mvp.model.entity.UserEntity;
import com.example.administrator.mvp.model.user.local.UserLocalModel;
import com.example.administrator.mvp.model.user.remote.UserRemoteModel;

/**
 * 用户数据仓库（请求数据的工具类）
 */
public class UserModel implements UserSource {
    //本地数据源
    private final UserLocalModel mLocalSource;
    //远程数据源
    private final UserRemoteModel mRemoteSource;

    public UserModel(Context context) {
        mLocalSource = new UserLocalModel(context);
        mRemoteSource = new UserRemoteModel(context);
    }

    @Override
    public Boolean login(String userName, String passWord) {
        return mRemoteSource.login(userName, passWord);
    }

    @Override
    public UserEntity getUserInfo(String token) {
        return mRemoteSource.getUserInfo(token);
    }

}
